package com.lyl.activiti.demo.listener;

import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

public class HuiQianListener implements TaskListener {


	public void notify(DelegateTask delegateTask) {
		DelegateExecution execution=delegateTask.getExecution();
		TaskService taskService = execution.getEngineServices()
				.getTaskService();

		delegateTask.setAssignee(String.valueOf(execution.getVariable("countersignUser")));
		// 开启流程后，设置会签人员
//		Task task = taskService.createTaskQuery().taskName("会签").singleResult();
//		taskService.setAssignee(delegateTask.getId(),
//				String.valueOf(execution.getVariable("countersignUser")));
	}
}
